<?php

namespace App\Api\Resources;

use Illuminate\Http\Resources\Json\JsonResource;

class CartResource extends JsonResource
{
    /**
     * Transform the resource into an array.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable
     */
    public function toArray($request)
    {
        return [
            'data_id' => $this->data_id,
            'product_id' => $this->product->data_id,
            'product_category' => $this->product->product_category,
            'product_category_text' => $this->product->product_category_text,
            'product_name' => $this->product->product_name,
            'product_thumb' => $this->product->product_thumb,
            'product_price' => $this->product->product_price,
            'product_discount_price' => $this->product->product_discount_price,
            'product_vip_price' => $this->product->product_vip_price,
            'num' => $this->num
        ];
    }
}
